
# The American Viewer: Political Consequences of Entertainment Media
# Eunji Kim and Shawn Patterson Jr 
# American Political Science Review 
# Replication File [Appendix L Figure L1]

celeb10 <- read.csv("appendix_figurel1.csv")


# Ensuring the 'Year' column is numeric
celeb10$Year <- as.numeric(as.character(celeb10$Year))

# Removing rows where 'Year' or 'N' is NA
celeb10 <- celeb10[!is.na(celeb10$Year) & !is.na(celeb10$N),]

# Sorting the data frame by 'Year'
celeb10 <- celeb10[order(celeb10$Year),]

# Creating the ggplot object


ggplot(celeb10, aes(x=Year, y=N)) +
  geom_point() +  # Add point layer
  geom_smooth(method = 'loess', se = TRUE, color = '#A40504') +  # Add a smoothing line
  labs(x="Year",
       y="Number of Celebrity Candidates") +
  theme_economist_white(gray_bg = FALSE, base_size = 14) +
  theme(axis.text.x=element_text(colour = "black", size = 13),
        axis.text = element_text(colour = "black"),
        axis.title = element_text(colour = "black"),
        axis.text.y = element_text(colour = "black", size = 12),
        strip.text = element_text(face = "bold", size= 14))
